#include<iostream>
#include<cstdio>
#include<signal.h>

int g_flag=0;

void changeflag(int signal)
{
    printf("将g_flag从%d改为1",g_flag);
    g_flag=1;
}

int main()
{
    signal(2,changeflag);
    while(!g_flag);//进入死循环
    printf("process quit\n");
    return 0;
}